package com.wing.member.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wing.member.model.entity.MemberLoginLog;
import com.wing.member.model.request.MemberLoginLogForm;
import com.wing.member.model.response.MemberLoginLogVO;
import com.wing.member.dao.MemberLoginLogDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 会员登录记录-ServiceImpl
 *
 * @author
 */
@Service
@Slf4j
public class MemberLoginLogServiceImpl extends ServiceImpl<MemberLoginLogDao, MemberLoginLog> implements MemberLoginLogService {

    @Override
    public int add(MemberLoginLogForm memberLoginLogForm) {
        //校验
        MemberLoginLog memberLoginLog = new MemberLoginLog();
        return baseMapper.insert(memberLoginLog);
    }

    @Override
    public List<MemberLoginLogVO> list4app(Map<String, Object> params) {
        return baseMapper.list4app(params);
    }

    @Override
    public Page<MemberLoginLogVO> pageList4app(Page page, Map<String, Object> params) {
        List<MemberLoginLogVO> list = baseMapper.list4app(page, params);
        page.setRecords(list);
        return page;
    }

    @Override
    public MemberLoginLogVO get4appById(Long id) {
        return baseMapper.get4appById(id);
    }

    @Override
    public Page<MemberLoginLog> pageList(Page page, Map<String, Object> params) {
        List<MemberLoginLog> list = baseMapper.list(page, params);
        page.setRecords(list);
        return page;
    }
}
